<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<@cms_site id=siteId!'' >
		<@cms_channel id=businessId!'' >
			<meta name="keywords" content="${(site.keywords)!''},${(tag_bean.name)!''}" />
			<title>${(tag_bean.name)!''}</title>
		</@cms_channel>
		</@cms_site>
	    <link rel="stylesheet" href="${ctx}/css/wechat/phone.css" />
	    <link rel="stylesheet" href="${ctx}/css/wechat/style.css" />
	    <link rel="stylesheet" href="${ctx}/js/weui/css/jquery-weui.min.css" />
	    <link rel="stylesheet" href="${ctx}/js/weui/css/weui.min.css" />
	    <script type="text/javascript" src="${ctx}/js/wechat/jQuery.1.8.2.min.js" ></script>
	    <script type="text/javascript" src="${ctx}/js/wechat/height.js" ></script>
	    <script type="text/javascript" src="${ctx}/js/weui/js/jquery-weui.min.js" ></script>
	    <script type="text/javascript" src="${ctx}/js/weui/js/city-picker.min.js" ></script>
	    <style>
	    	.bgImg{
	    		background: url(${ctx}/img/wechat/bg_opacity.png);
	    		background-size: 100% 100%;
	    		background-repeat: no-repeat;
	    		background-position: center;
	    	}
	    </style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row">
				<div class="col12">
					<@cms_content_list page=(returnDatas.page)! channelId=businessId>
						<#if tag_list?? && (tag_list?size>0)>
							<#list tag_list as _data>
								<#if _data_index==0>
									<div class="ht158 l-ht0 pos-r">
										<#if (_data.cover)??>
			               		 			<#assign json=(_data.cover)?eval/>
											<#list json as item>
												<img src="${ctx}${(item.path)!'/img/wechat/jwzx_listimg.jpg'}" class="per100 ht100p" />
											</#list>
										<#else>
											<img src="${ctx}/img/wechat/jwzx_listimg.jpg" class="per100 ht100p" />
			               		 		</#if>
										<div class="ht46 l-ht46 bgImg pos-a per100 left0 bottom0 font-white font14 font-yahei pl4 text-ellipsis1">
											${(_data.title)!''}
										</div>
									</div>
								</#if>
							</#list>
						</#if>
					</@cms_content_list>
					<input type="hidden"  value="2" id="pageIndex"/>
					<ul class="display-b bg-white" id="list">
						<@cms_content_list page=(returnDatas.page)! channelId=businessId>
							<#if tag_list?? && (tag_list?size>0)>
								<#list tag_list as _data>
									<#if _data_index==0>
									<#else>
										<li class="ht80 pl12" onclick="toDetail('${(_data.id)!''}');">
											<div class="overflow-h border-b-1 pr12">
												<div class="ht80 fl per70 pt10">
													<div class="ht36 l-ht18 text-ellipsis2 font14">
														${(_data.title)!''}
													</div>
													<div class="ht24 l-ht24 font-9">
														${(_data.createtime)!''}
													</div>
												</div>
												<div class="fl per30 ht80 pt10 tr">
													<#if (_data.cover)??>
						               		 			<#assign json=(_data.cover)?eval/>
														<#list json as item>
															<img src="${ctx}${(item.path)!'/img/wechat/jgyw_bszy.jpg'}" class="w-80 ht60" />
														</#list>
													<#else>
														<img src="${ctx}/img/wechat/jgyw_bszy.jpg" class="w-80 ht60" />
						               		 		</#if>
												</div>
											</div>
										</li>
									</#if>
								</#list>
							</#if>
						</@cms_content_list>
					</ul>
					<div class="weui-loadmore tc">
					  <i class="weui-loading"></i>
					  <span class="weui-loadmore__tips">正在加载</span>
					</div>
				</div>
			</div>
		</div>
	</body>
	
	<script>
		function toDetail(contentId){
			window.location = "${ctx}/f/mp/${siteId!''}/"+contentId;
		}
		
		/*控制上拉加载样式显示和隐藏*/
		jQuery(function(){
			var bodyHt=$('body').height();
			var containerHt=$('div.container-fluid').height();
			if(containerHt<bodyHt){
				$('div.weui-loadmore').hide();
			}else{
				$('div.weui-loadmore').show();
			}
		});
		
		/*上拉加载*/
		var loading = false;  //状态标记
		$(document.body).infinite().on("infinite", function() {
			if(loading) return;
			loading = true;
			setTimeout(function(){
				var pageIndex = $("#pageIndex").val();
				$.ajax({
					type:"post",
					url:"${ctx}/f/mp/${siteId!''}/${businessId!''}/dom",
					dataType:"html",
					data:{pageIndex:pageIndex},
					success:function(ret){
						$("#list").append(ret);
						if(!!ret){
							$("#pageIndex").val(parseInt($("#pageIndex").val())+1);
						}else{
							$('i.weui-loading').hide();
							$('span.weui-loadmore__tips').html();
							$('span.weui-loadmore__tips').html("没有数据了");
						}
					}
				});
				loading = false;
			}, 1500);   //模拟延迟
		});
	</script>
	
</html>
